import service from '@/utils/request.ts'
import {ApiResponse} from '@/store/dataType.ts'
export const API_DEPT = {
  // 查询部门列表
  listDept: (params?:any):Promise<ApiResponse> => {return service.get('/system/dept/list', { params })},
  
  // 查询部门列表（排除节点）
  listDeptExcludeChild: (deptId:string|number):Promise<ApiResponse> => {return service.get(`/system/dept/list/exclude/${deptId}`)},
  
  // 查询部门详情
  getDept: (deptId:string|number):Promise<ApiResponse> => {return service.get(`/system/dept/${deptId}`)},
  
  // 新增部门
  addDept: (data:any):Promise<ApiResponse> => {return service.post('/system/dept', data)},
  
  // 修改部门
  updateDept: (data:any):Promise<ApiResponse> => {return service.put('/system/dept', data)},
  
  // 删除部门
  delDept: (deptId:string|number):Promise<ApiResponse> => {return service.delete(`/system/dept/${deptId}`)}
}

